<template>
	<view>
		<view class="index_b_d_b_a" @click="goPage(item.id)" v-for="(item, index) in list">
			<view class="index_b_d_b_a_a">
				<custom-image :lazy-load="true" width="340rpx" height="340rpx" radius="0" lazy-load :src="item.image"></custom-image>
			</view>
			<view class="index_b_d_b_a_b">
				<view class="index_b_d_b_a_b_a">{{item.name}}</view>
				<view class="index_b_d_b_a_b_b">
					<view class="index_b_d_b_a_b_b_a" v-if="item.integral==0 && item.price>0">
						<view class="index_b_d_b_a_b_b_a_a"><span>￥</span>{{item.price}}<span v-if="">起</span></view>
						<view class="index_b_d_b_a_b_b_a_b">¥{{item.market_price}}</view>
					</view>
					<view class="index_b_d_b_a_b_b_a" v-if="item.price==0 && item.integral>0">
						<view class="index_b_d_b_a_b_b_a_a"><span>积分</span>{{item.integral}}</view>
					</view>
					<view class="index_b_d_b_a_b_b_a" v-if="item.price>0 && item.integral>0">
						<view class="index_b_d_b_a_b_b_a_a"><span>积分</span>{{item.integral}}+<span>¥</span>{{item.price}}</view>
					</view>
					<!-- <view class="index_b_d_b_a_b_b_b">已售{{item.order_num}}</view> -->
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import request from '@/common/request.js';
	export default {
		name:"GoodsList",
		props: {
			list: {
				type: Array,
				default: () => []
			},
			is_type:{ //1商品 2课程
				type: Number,
				default:1
			},
		},
		data() {
			return {
				baseUrl_img:request.baseUrl_img,
			};
		},
		methods: {
			goPage(id) {
				if(this.is_type==1){
					uni.navigateTo({
						url:'/pages/goods/info?id='+id
					});
				}
				if(this.is_type==2){
					uni.navigateTo({
						url:'/pages/curriculum/info?id='+id
					});
				}
			},
		}
	}
</script>
<style lang="scss" scoped>
	.index_b_d_b_a{
		width: 340rpx;
		border-radius: 10rpx;
		margin-left: 23rpx;
		float: left;
		margin-bottom: 20rpx;
		overflow: hidden;
	}
	.index_b_d_b_a_a{
		width: 340rpx;
		height: 340rpx;
	}
	.index_b_d_b_a_b{
		//padding: 25rpx;
		overflow: hidden;
	}
	.index_b_d_b_a_b_a{
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #000000;
		line-height: 70rpx;
		height: 70rpx;
		overflow: hidden;   
		text-overflow:ellipsis;    
		white-space: nowrap;
	}
	.index_b_d_b_a_b_b{
		// margin-top: 20rpx;
		overflow: hidden;
		line-height: 45rpx;
	}
	.index_b_d_b_a_b_b_a{
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: 800;
		color: #E71102;
		float: left;
	}
	.index_b_d_b_a_b_b_a_a{
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: 800;
		color: #E71102;
		float: left;
	}
	.index_b_d_b_a_b_b_a_a span{
		font-size: 24rpx;
	}
	.index_b_d_b_a_b_b_b{
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #999999;
		float: right;
	}
</style>
